package org.smile.day03;

/**
 * 一个清理程序
 * 一个保洁员
 * 若干个办公器具
 * <p>
 * 计算费用
 * <p>
 * 办公器具被谁清理过
 */
public class Application {

    public static void main(String[] arg) {
        //1.生成一个保洁员
//        Cleaner cleaner = new Cleaner();
//        cleaner.setId(new Long(10001));
//        cleaner.setName("保洁员1");

        Cleaner cleaner = new Cleaner("保洁员2", new Long(10002));
//        Cleaner cleaner = new Cleaner("保洁员2", new Long(10002));
//        Cleaner cleaner = new Cleaner("保洁员2", new Long(10002));


        //2.生成若干个办公器具
        Office[] offices = new Office[100];
        Office desk1 = new Office("1号", "办公桌");
        offices[0] = desk1;

        Office desk2 = new Office();
        desk2.setName("2号");
        desk2.setType("办公桌");
        offices[1] = desk2;

        Office screen1 = new Office();
        screen1.setType("屏幕");
        screen1.setName("1号");
        offices[2] = screen1;

        //3.清理
        cleaner.clean(desk1);
        cleaner.clean(desk2);
        cleaner.clean(screen1);

        //3.1清理
        desk1.clean(cleaner);
        desk2.clean(cleaner);
        screen1.clean(cleaner);


        //4.计算费用
        System.out.println(cleaner.getTotal());

        //5.显示办公器具被谁清理
        desk1.showCleaner();
        desk2.showCleaner();
        screen1.showCleaner();

        for (Office office : offices) {
            office.showCleaner();
        }

    }

}
